﻿using HAF.Core.Datas;
using System;
using System.Collections.Generic;

namespace RDS.Core
{
    /// <summary>
    /// 运行时控制器
    /// </summary>
    public static class RuntimeAdapter
    {
        #region 系统基础信息
        /// <summary>
        /// 程序展示名称
        /// </summary>
        public static string AppName { get; set; }
        /// <summary>
        /// 版本号
        /// </summary>
        public static string AppVersion { get { return "V1.3.3"; } }
        /// <summary>
        /// RDS主机地址
        /// </summary>
        public static string HostAddress { get; set; }
        /// <summary>
        /// 应用启动地址
        /// </summary>
        public static string AppDir { get; set; }
        /// <summary>
        /// 插件目录
        /// </summary>
        public static string PluginDir { get; internal set; } = "Plugins";
        /// <summary>
        /// 配置文件目录
        /// </summary>
        public static string ConfigDir { get; internal set; } = "Config";
        /// <summary>
        /// 模板文件目录
        /// </summary>
        public static string TemplateDir { get; internal set; } = "Template";
        /// <summary>
        /// 系统磁盘列表
        /// </summary>
        public static string[] Disks { get; set; }
        #endregion 系统基础信息

        /// <summary>
        /// 主机IP
        /// </summary>
        public static string HostIP { get; set; }
        /// <summary>
        /// 主机端口
        /// </summary>
        public static int HostPort { get; set; }
        /// <summary>
        /// 主机名称
        /// </summary>
        public static string HostName { get; set; }
        /// <summary>
        /// 拷贝主机信息
        /// </summary>
        public static SoftwareRuntimeBase Info { get; set; }
        /// <summary>
        /// C2服务地址
        /// </summary>
        public static string WasServiceUrl { get; set; }
        /// <summary>
        /// C1服务地址
        /// </summary>
        public static string EpgServiceUrl { get; set; }
        /// <summary>
        /// 回馈服务地址
        /// </summary>
        public static string WasNotifyUrl { get; set; }
        /// <summary>
        /// 当前终端信息
        /// </summary>
        public static Terminal Terminal { get; set; }
        /// <summary>
        /// 外部插件集合
        /// </summary>
        public static ThirdPlugins RunPugins { get; set; }
        /// <summary>
        /// 注册类型
        /// </summary>
        public static string RegistType { get; set; }
        /// <summary>
        /// 注册关联主机  IP转数字做key，可访问性做value
        /// </summary>
        /// <remarks>该属性用于判断主机可达性</remarks>
        public static Dictionary<long, bool> RegistHosts { get; set; } = new Dictionary<long, bool>();
        /// <summary>
        /// 任务列表
        /// </summary>
        public static List<RunTask> Tasks { get; set; } = new List<RunTask>();
        /// <summary>
        /// 输出消息到控制台
        /// </summary>
        public static Action<string> ShowConsol { get; set; }
        /// <summary>
        /// 进度输出
        /// </summary>
        public static Action<int> ProcessChangeEvent { get; set; }
        /// <summary>
        /// 状态输出
        /// </summary>
        public static Action<int, long, long, long, long> StateChangeEvent { get; set; }
        /// <summary>
        /// 是否进行日志上报
        /// </summary>
        public static bool AllowReportLog { get; set; }
        /// <summary>
        /// 日志上报地址
        /// </summary>
        public static string LogEngine { get; set; }
        /// <summary>
        /// 网盘集合
        /// </summary>
        public static Dictionary<string, bool> NetDisks { get; set; }
        /// <summary>
        /// 公用循环判断
        /// </summary>
        public static bool RunRepeat { get; set; } = true;
        /// <summary>
        /// 跨日时执行的任务
        /// </summary>
        public static Action<int> RunDayAction { get; set; }
    }
}
